package com.bemes.ecmn.model;

public class ECMNAvgAggregator extends ECMNAggregator {

	@Override
	public int getAmountOfEquipment() {
		
		if(m_connectors.isEmpty())
		{
			return 0;
		}
		else
		{
			int totalAmountOfEq = 0;
			for(ECMNConnector con : m_connectors)
			{
				totalAmountOfEq += con.getAmountOfEquipment();
			}
			
			return ((int)Math.ceil((double) totalAmountOfEq / (double) m_connectors.size()));
		}
	}
}
